// #1 引入 applyMiddleware
import { createStore, applyMiddleware, compose } from 'redux'
// #2 引入中间件
import logger from 'redux-logger'
import thunk from 'redux-thunk'
import rootReducer from './reducers'
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
// #3 应用中间件
export default createStore(
  rootReducer,
  composeEnhancers(applyMiddleware(thunk, logger))
)
